package com.cloud.Controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * @Author: TongRui乀
 * @Date: 2019/10/15 17:02
 * @description：
 */
@RestController
public class WebController {

    @Autowired
    private RestTemplate restTemplate;


    @GetMapping("getService")
    public String getService(){
        return restTemplate.getForObject("http://cloud-service-02-Ribbon/service2", String.class);
    }


    @GetMapping("service")
    public String hi(){
        return "i am service-01";
    }


    @GetMapping("getPythonUser")
    public String getPythonUser(){
        return this.restTemplate.getForEntity("http://cloud-sidecar/getUser", String.class).getBody();
    }
}
